package subject_set.weekly_competition.day10_1;

/**
 * @author haomin
 * @date 2022/10/01 22:29
 **/
public class Num3 {
    class LUPrefix {
        boolean[] arr;
        int i;
        public LUPrefix(int n) {
            arr = new boolean[n+2];
            arr[0] = true;
            i = 1;
        }

        public void upload(int video) {
            arr[video] = true;
            if(video == i) i++;
            while(arr[i]) i++;
        }

        public int longest() {
            return i-1;
        }
    }
}